package com.example.demo.singoton;

/**
 * @Description
 * @Author youxin
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2021/12/22
 */
public class SingletonTest3 {
    public static void main(String[] args) {

    }

}
    class Singleton3{
        private Singleton3(){}
       private  static Singleton3 singleton3;
        public static synchronized Singleton3 getSingleton3(){
            if(singleton3==null){
                singleton3=new Singleton3();
            }
            return singleton3;
        }

    }

